<template>
  <!-- 详情 -->
  <el-dialog
    :visible.sync="dialogVisible"
    title="散杂货申报管理详情"
    width="50%"
    append-to-body
    :close-on-click-modal="false"
    :before-close="closedialog"
    class="self-dialog"
  >
  <el-tabs v-model="activeName" v-if="dialogVisible">
      <el-tab-pane label="基本信息" name="first">
        <el-descriptions
      :column="2"
      border
    >
      <el-descriptions-item>
        <template slot="label"> 绑定介质类型 </template>
        <dict-tag
          :options="dict.type.sgs_bind_key_type"
          :value="form.bindKeyType"
        />
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 绑定介质关键信息 </template>
        {{ form.bindKeyInfo }}
      </el-descriptions-item>
      <!-- <el-descriptions-item>
        <template slot="label"> 车次确认号 </template>
        {{ form.sureId }}
      </el-descriptions-item> -->
      <el-descriptions-item>
        <template slot="label"> 业务类型 </template>
        <dict-tag :options="dict.type.sgs_rd_code" :value="form.rdCode" />
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 运输方式 </template>
        <dict-tag
          :options="dict.type.sgs_decl_traf_mode"
          :value="form.declTrafMode"
        ></dict-tag>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 进出口标志 </template>
        <dict-tag :options="dict.type.sys_i_e_flag" :value="form.iEFlag" />
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 过卡车辆类型 </template>
        <dict-tag
          :options="dict.type.sgs_bayonet_rd_code"
          :value="form.bayonetRdCode"
        />
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 做单所属海关 </template>
        <dict-value
          :list="customsList"
          :dictCode="form.customsCode"
        ></dict-value>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 做单场所 </template>
        {{ form.fieldCode }} - {{ form.fieldName }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 过卡海关 </template>
        <dict-value
          :list="customsList"
          :dictCode="form.customsMaster"
        ></dict-value>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 过卡场所 </template>
        {{ form.bayonetFieldCode }} - {{ form.bayonetFieldName }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 组织机构代码 </template>
        {{ form.contractorCode }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 组织机构统一信用代码 </template>
        {{ form.contractorCodeScc }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 车辆重量 </template>
        {{ form.vehicleWeight }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 挂车重量 </template>
        {{ form.trailerWeight }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 集装箱重量 </template>
        {{ form.contaWeight }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 报关企业代码 </template>
        {{ form.entCode }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 申报状态 </template>
        <dict-tag
          :options="dict.type.sgs_decl_status"
          :value="form.declStatus"
        />
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 申报报文ID </template>
        {{ form.msgId }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 申报时间 </template>
        {{ form.declTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 回执状态 </template>
        {{ form.rcptStatus }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 回执说明 </template>
        {{ form.rcptRemark }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 创建人 </template>
        {{ form.createBy }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 创建时间 </template>
        {{ form.createTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 更新人 </template>
        {{ form.updateBy }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 更新时间 </template>
        {{ form.updateTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 备注 </template>
        {{ form.remark }}
      </el-descriptions-item>
    </el-descriptions>
      </el-tab-pane>
      <el-tab-pane label="散杂货申报列表" name="second">
        <sub-list dialogType="detail" :bulkCargoListData="form.bulkCargoListList"></sub-list>
      </el-tab-pane>
  </el-tabs>

    <div slot="footer" class="dialog-footer" style="text-align: center">
      <el-button @click="closedialog">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { getSgsBulkCargoHead } from "@/api/swdecl/sgsBulkCargoHead";
import subList from './subList.vue';
export default {
  components: { subList },
  props: {
    detailId: {},
    dict: {},
    customsList: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {
      //显示详情
      dialogVisible: false,
      activeName: "first",
      form: {
        id: null,
        sureId: null,
        opTime: null,
        opUserId: null,
        bindKeyType: null,
        bindKeyInfo: null,
        rdCode: null,
        declTrafMode: null,
        iEFlag: null,
        customsCode: null,
        fieldCode: null,
        fieldName: null,
        customsMaster: null,
        bayonetFieldCode: null,
        bayonetFieldName: null,
        contractorCode: null,
        contractorCodeScc: null,
        bayonetRdCode: null,
        vehicleWeight: null,
        trailerWeight: null,
        contaWeight: null,
        remark: null,
        declStatus: "0",
        declTime: null,
        rcptStatus: "0",
        rcptRemark: null,
        msgId: null,
        entCode: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
      },
    };
  },
  watch: {
    detailId: {
      immediate: true,
      handler(val) {
        if (val) {
          this.loadDetail();
        }
      },
    },
  },
  methods: {
    open() {
      this.dialogVisible = true;
      this.activeName = "first";
    },
    closedialog() {
      this.dialogVisible = false;
    },
    // 获取详情
    loadDetail() {
      getSgsBulkCargoHead(this.detailId).then((res) => {
        if (res.code == 200) {
          this.form = res.data;
        }
      });
    },
  },
};
</script>

<style>
</style>
